package com.gzy.cbrsystem.shimian.action;

import com.opensymphony.xwork2.ActionSupport;
import com.gzy.cbrsystem.shimian.dao.ShimianBingzhen;
import com.gzy.cbrsystem.shimian.po.ShimianCase;
import com.gzy.cbrsystem.shimian.service.*;

public class ViewShimianCase extends ActionSupport {
	protected CaseReasoning caseReasoning;
	
	protected ShimianBingzhen shimianBingzhen;

	public void setShimianBingzhen(ShimianBingzhen shimianBingzhen) {
		this.shimianBingzhen = shimianBingzhen;
	}

	public ShimianBingzhen getShimianBingzhen() {
			return this.shimianBingzhen;
	}
	protected String id;

	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return this.id;
	}
	public void setCaseReasoning(CaseReasoning caseReasoning) {
		this.caseReasoning = caseReasoning;
	}

	public CaseReasoning getCaseReasoning() {
		return this.caseReasoning;
	}

	public String execute() throws Exception {
		ShimianBingzhen sc = this.caseReasoning.findBingzhenByID(id);
		String result = SUCCESS;
		if (sc == null) {
			return result = ERROR;
		} else {
			this.setShimianBingzhen(sc);
		}
		return result;
	}
}
